﻿using System;
using System.Collections.Generic;
using System.Text;

namespace SuperX.Helper.PageBreak
{
    public class PageResult<T>
    {
        public PageResult()
        {
        }

        /// <summary>
        /// 分页
        /// </summary>
        /// <param name="pageInput">分页参数</param>
        /// <param name="values">需要分页的集合</param>
        public PageResult(PageInputBase pageInput, ICollection<T> values)
        {
            PageNo = pageInput.PageNO;
            PageSize = pageInput.PageSize;
            TotalPage = pageInput.TotalPage;
            TotalRows = pageInput.TotalRows;
            Rows = values;
        }

        public int PageNo { get; set; } = 1;
        public int PageSize { get; set; } = 50;
        public int TotalPage { get; set; } = 0;
        public int TotalRows { get; set; } = 0;
        public ICollection<T> Rows { get; set; }
    }
}